home *** CD-ROM | disk | FTP | other *** search
- global Obj, dbsectionnum, sectionname, fileName, content, linestart, workingdb, rosso, giallo, verde, lastmc, hotcast, db, currentNetHandler, curSubSection, curLine
-
- on startMovie
- preLoad(frame, 2, 10)
- preLoad(cast 194, 195, 196, 197)
- set lastmc to -1
- set hotcast to [190, 191, 192, 193, 194, 195, 196, 197, 177, 207, 208, 209, 210]
- resetsprites()
- resetsprites2()
- set content to EMPTY
- repeat with a = 26 to 29
- puppetSprite(a, 1)
- end repeat
- initcolors()
- settastili(3, 8)
- bootstrap()
- initDB()
- end
-
- on initDB
- put " " into field (1000 + workingdb)
- put " " into field (1100 + workingdb)
- settastili(3, 8)
- processdb(line workingdb of fileName, workingdb)
- showsubsection(workingdb)
- end
-
- on games
- set workingdb to 1
- initDB()
- end
-
- on Internet
- set workingdb to 2
- initDB()
- end
-
- on GIFTS
- set workingdb to 3
- initDB()
- end
-
- on CDrom
- set workingdb to 4
- initDB()
- end
-
- on stopMovie
- clearall()
- end
-
- on clearall
- settastili(3, 8)
- put " " into field 1001
- put " " into field 1002
- put " " into field 1003
- put " " into field 1004
- put " " into field 1101
- put " " into field 1102
- put " " into field 1103
- put " " into field 1104
- end
-
- on showsubsection dbindex
- set the text of field "sottosezione" to the text of field (1000 + dbindex)
- end
-
- on checkclickedline
- set linea to the mouseLine
- cursor(4)
- if linea > 0 then
- set the foreColor of field "sottosezione" to giallo
- set the foreColor of line linea of field "sottosezione" to verde
- resetsprites()
- resetsprites2()
- if workingdb = 2 then
- set curSubSection to linea
- set tempnome to EMPTY
- set tempField to the text of field (500 + linea)
- repeat with N = 1 to the number of lines in tempField
- put item 1 of line N of tempField & RETURN after tempnome
- put tempnome into field "nome"
- end repeat
- cursor(-1)
- return
- end if
- if workingdb = 4 then
- set curSubSection to linea
- set tempnome to EMPTY
- set tempField to the text of field (511 + linea)
- repeat with N = 1 to the number of lines in tempField
- put item 2 of line N of tempField & RETURN after tempnome
- put tempnome into field "nome"
- end repeat
- cursor(-1)
- return
- end if
- set linestart to value(line linea of field (1100 + workingdb))
- if linea <> the number of lines in field "sottosezione" then
- set linestop to value(line linea + 1 of field (1100 + workingdb)) - 1
- else
- set linestop to the number of lines in content
- end if
- settastili(4, 8)
- set tempnome to EMPTY
- put "linestart" && linestart
- put "linestop" && linestop
- repeat with N = linestart to linestop
- put item 2 of line N of content & RETURN after tempnome
- put tempnome into field "nome"
- end repeat
- end if
- cursor(-1)
- end
-
- on checkclickedlinenome
- set linea to the mouseLine
- if linea > 0 then
- resetsprites2()
- resetsprites()
- set selection to linea
- set the foreColor of field "nome" to giallo
- set the foreColor of line linea of field "nome" to verde
- if workingdb = 2 then
- set curField to the text of field (500 + curSubSection)
- set the text of field "tecnico" to item 3 of line linea of curField
- set the text of field "testo" to item 2 of line linea of curField
- set the text of field "path" to item 5 of line linea of curField
- set the text of field "URL" to item 4 of line linea of curField
- set votazzo to char 1 of item 7 of line linea of curField
- else
- if workingdb = 4 then
- set curField to the text of field (511 + curSubSection)
- set the text of field "tecnico" to item 4 of line linea of curField
- set the text of field "testo" to item 3 of line linea of curField
- set the text of field "path" to item 6 of line linea of curField
- set the text of field "URL" to item 5 of line linea of curField
- set votazzo to char 1 of item 8 of line linea of curField
- else
- set the text of field "tecnico" to item 4 of line linea + linestart - 1 of content
- set the text of field "testo" to item 3 of line linea + linestart - 1 of content
- set the text of field "path" to FullPath(item 6 of line linea + linestart - 1 of content)
- set the text of field "URL" to item 5 of line linea + linestart - 1 of content
- set votazzo to char 1 of item 8 of line linea + linestart - 1 of content
- set curLine to linea
- end if
- end if
- if workingdb = 3 then
- set curGiftOS to item 7 of line curLine + linestart - 1 of content
- if Installable(curGiftOS) then
- set the visible of sprite 7 to 1
- set the visible of sprite 8 to 1
- set the visible of sprite 9 to 1
- end if
- end if
- put votazzo
- if value(votazzo) > 4 then
- set the visible of sprite 16 to 1
- end if
- set the visible of sprite (10 + value(votazzo)) to 1
- end if
- end
-
- on resetsprites2
- repeat with a = 7 to 9
- set the visible of sprite a to 0
- end repeat
- end
-
- on resetsprites
- repeat with a = 11 to 16
- set the visible of sprite a to 0
- end repeat
- end
-
- on initcolors
- set blu to the foreColor of field "blu"
- set giallo to the foreColor of field "giallo"
- end
-
- on bootstrap
- set sectionname to EMPTY
- set fileName to EMPTY
- set the itemDelimiter to TAB
- set Obj to FileIO(mnew, "read", the pathName & "config.db")
- if not objectp(Obj) then
- alert("no oggetto" & Obj)
- end if
- set content to Obj(mReadFile)
- put Obj(mdispose)
- set dbsectionnum to the number of lines in content
- repeat with N = 1 to dbsectionnum
- put item 1 of line N of content after line N of sectionname
- put item 2 of line N of content after line N of fileName
- end repeat
- end
-
- on processdb dbase, dbindex
- if dbindex = 2 then
- set the text of cast 1002 to the text of cast 500
- return
- end if
- if dbindex = 4 then
- set the text of cast 1004 to the text of cast 535
- return
- else
- if dbindex = 3 then
- set content to the text of field "gift"
- else
- if dbindex = 1 then
- set content to the text of field "dbgames"
- end if
- end if
- end if
- set numlines to the number of lines in content
- set old to EMPTY
- set a to 1
- repeat with N = 1 to numlines
- set new to item 1 of line N of content
- if new <> old then
- put new after line a of field (1000 + dbindex)
- put N after line a of field (1100 + dbindex)
- set a to a + 1
- set old to new
- end if
- end repeat
- end
-
- on settastili x, y
- repeat with N = x to y
- set the text of field N to " "
- set the textFont of field N to "monaco"
- set the textSize of field N to 10
- set the textStyle of field N to "plain"
- if the foreColor of field N <> giallo then
- set the foreColor of field N to giallo
- end if
- end repeat
- end
-
- on suoppatasto spriteNum, castDown, handler
- set flegghino to 0
- set SaveCast to the castNum of sprite spriteNum
- set flegghino to suicciacast(spriteNum, SaveCast, castDown)
- repeat while the stillDown
- set flegghino to suicciacast(spriteNum, SaveCast, castDown, flegghino)
- end repeat
- puppetSprite(spriteNum, 0)
- if flegghino = 1 then
- do(handler)
- end if
- end
-
- on suicciacast spriteNum, SaveCast, castDown
- if rollOver(spriteNum) then
- set the castNum of sprite spriteNum to castDown
- updateStage()
- return 1
- else
- set the castNum of sprite spriteNum to SaveCast
- updateStage()
- return 0
- end if
- end
-
- on gherollero
- set thismc to the mouseCast
- if lastmc = thismc then
- if getOne(hotcast, thismc) then
- mousewithin(script thismc)
- end if
- end if
- if lastmc <> thismc then
- if getOne(hotcast, lastmc) then
- mouseexit(script lastmc)
- end if
- if getOne(hotcast, thismc) then
- mouseenter(script thismc)
- end if
- set lastmc to thismc
- end if
- end
-
- on idle
- if the machineType = 256 then
- do(currentNetHandler)
- end if
- gherollero()
- end
-
- on resetall
- set the castNum of sprite 26 to 190
- set the castNum of sprite 27 to 191
- set the castNum of sprite 28 to 192
- set the castNum of sprite 29 to 193
- end
-